Flash CS4 [AS3]: Playing Card Deck Array

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2009-12-15T00:25:59Z Indexed on 2010/05/22 22:10 UTC
Read the original article Hit count: 289

I am looking to make a card game in Flash CS4 using AS3 and I am stuck on the very first step.

I have created graphics for a standard 52 card deck of playing cards and imported them into the library in Flash and then proceeded to convert them all to Movie Clips.

I have also used the linkage to make them available in the code. The movie clips and the linkage are named in sequence, as in the Ace of Clubs would be C1, two of Diamonds is called D2, Jack of Spades is S11. (C = Clubs, D = Diamonds, S = Spades, H = Hearts and numbers 1 through 13 are the card values. 1 being Ace, 11 being Jack, 12 being Queen, 13 being King).

As far as I know my next step would be to arrange the cards into an array. This is the part that I am having problems with. Can someone please point me in the right direction, what would be the best way to do this. Could you provide me with a bit of sample code as well?

I have had a look at few tutorials online but they are all telling me different things, some are incomplete and the rest...well...they're just cr*ppy.

Thanks in advance! Ben

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript-3